<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <!--[if lt IE 9]>
    <script type="text/javascript" src="/Public/Admin/extend/lib/html5shiv.js"></script>
    <script type="text/javascript" src="/Public/Admin/extend/lib/respond.min.js"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="/Public/Admin/extend/static/h-ui/css/H-ui.min.css" />
    <link rel="stylesheet" type="text/css" href="/Public/Admin/extend/static/h-ui.admin/css/H-ui.admin.css" />
    <link rel="stylesheet" type="text/css" href="/Public/Admin/extend/lib/Hui-iconfont/1.0.8/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="/Public/Admin/extend/static/h-ui.admin/skin/default/skin.css" id="skin" />
    <link rel="stylesheet" type="text/css" href="/Public/Admin/extend/static/h-ui.admin/css/style.css" />
    <!--[if IE 6]>
    <script type="text/javascript" src="/Public/Admin/extend/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
    <script>DD_belatedPNG.fix('*');</script>

    <![endif]-->
    <title>编辑取消理由 - 救护管理</title>
    <style>
        .filea {
            position: relative;
            display: inline-block;
            background: #D0EEFF;
            border: 1px solid #99D3F5;
            border-radius: 4px;
            padding: 4px 12px;
            overflow: hidden;
            color: #1E88C7;
            text-decoration: none;
            text-indent: 0;
            line-height: 20px;
        }
        .filea input {
            position: absolute;
            font-size: 100px;
            right: 0;
            top: 0;
            opacity: 0;
        }
        .filea:hover {
            background: #AADFFD;
            border-color: #78C3F3;
            color: #004974;
            text-decoration: none;
        }

        .upimg_block .showimg{height: auto; width: auto\9; }
        .upimg_block .imglist_box{}
        .upimg_block .imglist_box{ width:100%; margin:auto; }
        .upimg_block .imglist_box ul{float:left; width:50%; margin-bottom:20px;}
        .upimg_block .imglist_box li{margin:auto; float:left; width:33%; text-align:center; }
        .upimg_block .imglist_box li img{ width:100%; height:80px;}
        .upimg_block .imglist_box li a{ margin:5px; display:block;}
        .typea{background: #AADFFD;}
    </style>
</head>
<body>
<article class="page-container">
    <span style="color:gray;fone-size:1.2em">取消理由编辑</span>
    <form class="form form-horizontal" id="form-admin-edit">
        <input type="hidden" name="id" value="<?php echo ($data['id']); ?>">
       
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>名称：</label>
            <div class="formControls col-xs-8 col-sm-10">
                <input type="text" class="input-text" placeholder="" id="name" name="name" value="<?php echo ($data['name']); ?>">
            </div>
        </div>
        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                <input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;保存&nbsp;&nbsp;">
                <input class="btn btn-danger radius" type="button" onclick="admin_del(this,<?php echo ($data['id']); ?>)" value="&nbsp;&nbsp;删除&nbsp;&nbsp;">
            </div>
        </div>
    </form>
</article>

<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="/Public/Admin/extend/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="/Public/Admin/extend/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="/Public/Admin/extend/static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="/Public/Admin/extend/static/h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="/Public/Admin/extend/lib/jquery.validation/1.14.0/jquery.validate.js"></script>
<script type="text/javascript" src="/Public/Admin/extend/lib/jquery.validation/1.14.0/validate-methods.js"></script>
<script type="text/javascript" src="/Public/Admin/extend/lib/jquery.validation/1.14.0/messages_zh.js"></script>

<script src="/Public/Admin/extend/lib/exif.js?v=b26c6d5"></script>
<script src="/Public/Admin/extend/lib/lrz.js?v=c105d63"></script>
<script type="text/javascript">
   
    function admin_del(obj,id){
        layer.confirm('确认要删除吗？',function(index){
            $.ajax({
                type: 'POST',
                url: '<?php echo U("Admin/Rescue/delReason");?>',
                data: {
                    id : id
                },
                dataType: 'json',
                success: function(data){
                    if(data.status){
                        $(obj).parents("tr").remove();
                        layer.msg('已删除!',{icon:1,time:1000});
                        setTimeout((function() {
                            parent.window.location.href="<?php echo U('Admin/Rescue/reasonlist');?>";
                        }), 500);
                    }else{
                        layer.msg(data.info, {icon:7,time:1000});
                    }
                },
                error:function(data) {
                    console.log(data.msg);
                },
            });
        });
    }


    $(function(){
        $('.skin-minimal input').iCheck({
            checkboxClass: 'icheckbox-blue',
            radioClass: 'iradio-blue',
            increaseArea: '20%'
        });

        $("#form-admin-edit").validate({
            rules:{
                name:{
                   required:true,
                },
            },
            onkeyup:false,
            focusCleanup:true,
            success:"valid",
            submitHandler:function(form){
               
                    $(form).ajaxSubmit({
                        type: 'post',
                        url: "<?php echo U('Admin/Rescue/reasonEdit');?>" ,
                        success: function(data){
                            if(data.status){
                                layer.msg(data.info,{icon:1,time:1000});
                                setTimeout((function() {
                                    parent.window.location.href="<?php echo U('Admin/Rescue/reasonList',array('id'=>$data['id']));?>";
                                }), 1500);
                            }else{
                                layer.msg(data.info,{icon:2,time:1000});
                            }
                        },
                        error: function(XmlHttpRequest, textStatus, errorThrown){
                            layer.msg('error!',{icon:5,time:1000});
                        }
                    });
               

            }
        });
    });
</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>